#include<iostream>
using namespace std;
int main(){
	int a,ans=0,now;
	cin>>a;
	now=a;
	while(now!=1){
		for(int i=2;i<=now;i++){
			if(now%i==0){
				ans+=now/i;
				now=now/i;
				break;
			}
		}
	}
	cout<<ans;
}
